 <html> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<title>JS实现改变控件显示不同按钮效果</title>
<script type="text/javascript">
    function getObj(id){
       return document.getElementById(id);
    }
	function butSelect(){
		var selval = getObj("sel").value;
		if(selval == "1"){
			getObj("btn").innerHTML = '<input type="button" value="按钮1" onclick="btnl();">';
		}
		else if(selval == "2"){
			getObj("btn").innerHTML = '<input type="button" value="按钮2" onclick="btn2();">';
		}
		else if(selval == "3"){
			getObj("btn").innerHTML = '<input type="button" value="按钮3" onclick="btn3();">';
		}
		else{
			getObj("btn").innerHTML = '';
		}
	}
	function btnl(){
		alert("单击了按钮1");
	}
	function btn2(){
		alert("单击了按钮2");
	}
	function btn3(){
		alert("单击了按钮3");
	}

</script> 
</head> 
<body> 
 <select id="sel" name="sel" onchange="butSelect()" style="width:100px;">
   <option value="1">按钮1</option>
   <option value="2">按钮2</option>
   <option value="3">按钮3</option>
 </select>
 <span id="btn">

 </span>
</body> 
</html> 
